﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Vanfa.Entities.User;
using Vanfa.Biz.User;

namespace Vanfa.Web.control
{
    public partial class wucMemberInfo : System.Web.UI.UserControl
    {
        public string UserName { protected get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                var m = UserMag.GetUserTicket(UserName);
                if (m == null)
                    return;
                switch (m.UserType)
                {
                    case 1:
                        var pp = UserProfileMag.LoadPrivInfo(m.UserID);
                        iconUser.Src = pp.Icon;
                        lNickName.Text = pp.NickName;
                        break;
                    case 2:
                        var gp = UserProfileMag.LoadGroupInfo(m.UserID);
                        iconUser.Src = gp.Icon;
                        lNickName.Text = gp.GourpName;
                        break;
                }
            }
        }
    }
}